package kr.haggenna.item.dao;

import java.util.List;

import kr.haggenna.item.domain.Item;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Component;

@Component
public class ItemDaoImpl extends SqlSessionDaoSupport implements ItemDao{
	@Override
	public List<Item> getCoffeeList(){
		List<Item> list = getSqlSession().selectList("coffeeList");
		return list;
	}
	@Override
	public List<Item> getBeverageList() {
		List<Item> list = getSqlSession().selectList("beverageList");
		return list;
	}
	@Override
	public List<Item> getBakeryList() {
		List<Item> list = getSqlSession().selectList("bakeryList");
		return list;
	}
	
	@Override
	public List<Item> getItemList() {
		List<Item> list = getSqlSession().selectList("itemList");
		return list;
	}
	
	@Override
	public Item getGiftcard(int item_num) {
		Item item = getSqlSession().selectOne("giftcard", item_num);
		return item;
	}
	
	@Override
	public List<Item> getGiftcardList() {
		List<Item> list = getSqlSession().selectList("giftcardList");
		return list;
	}
	
	@Override
	public Item getItemByName(String item_name) {
		Item item = getSqlSession().selectOne("getItemByName", item_name);
		return item;
	}
}
